const express = require('express')
const path = require('path')
const router = require('./routes/session')
const app = express()
//配置art-template
app.engine('html',require('express-art-template'))
app.set('views',path.join(__dirname,'views')) 
//开放静态资源
app.use('/public', express.static(path.join(__dirname, 'public')))
app.use('/node_modules', express.static(path.join(__dirname, 'node_modules')))
//配置以获取req.body
app.use(express.json())
app.use(express.urlencoded({ extended: true }))

app.use(router)

app.listen(3000, function() {
    console.log('running...')
})